<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
	<title>服务网点</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/StaticResource/jslib/jquery-easyui-1.3.4/themes/metro-orange/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/StaticResource/jslib/jquery-easyui-1.3.4/themes/icon.css"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/StaticResource/zTree3.4/css/zTreeStyle/zTreeStyle.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/StaticResource/jslib/autocomplete/jquery.autocomplete.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/StaticResource/css/city.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/jslib/jquery-easyui-1.3.4/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/jslib//jquery-easyui-1.3.4/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/jslib/jquery-easyui-1.3.4/locale/easyui-lang-zh_CN.js" charset="UTF-8"></script>
	<script type="text/javascript" src="http://app.mapabc.com/apis?t=flashmap&v=2.4&key=f0628929f66261cb4780241da76317bde09101be39cfd83abeb3ec7c1dea5322dc3e654f70e32c29"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/js/collection.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/mapeditor/mapabcEditor.js?v=1.05"></script>	
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/zTree3.4/js/jquery.ztree.all-3.4.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/jslib/autocomplete/jquery.autocomplete.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/js/citylist.js"></script>
	<script type="text/javascript" src="${pageContect.request.contextPath}/StaticResource/js/poisearch.js?v=0.1.23"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/StaticResource/js/city_u.js?v=0.1.0"></script>
	<style type="text/css">
	a{color:#0781d3; cursor:pointer;border:0;margin:0;padding:0; display:inline;}
	a:link{text-decoration:none}
	a:visited{text-decoration:none}
	a:hover{color:#0781d3; cursor:pointer;text-decoration:underline}
	span a{margin-right:10px}
	.treeContent{
		padding-left:10px;
		border-bottom:8px solid transparent;
		border-image:url(${pageContext.request.contextPath}/StaticResource/images/navbottom.gif) 0 0 8 0 repeat;
	}
	.MFMP_pngImg0 {display: none;}
	.input_def {
		width: 365px;
		height: 22px;
		margin-top:10px;
		float:right;
		border: 1px solid #c7c7c7;
		color: #a8a8a8;
	}
	.searchBtn {
		float:right;
		margin-top:20px;
	}
	.keywordSearch {
	 	padding:15px 10px;
	}
	.title{background:#f5f5f5;line-height:25px;text-indent:10px;font-weight:bold;color:#a8a8a8;}
	.no_answer{ width:353px; height:20px; line-height:20px; text-align:center; font-size:12px; margin:10px auto; color:#cf7f00; border:1px solid #ffefbd; background:#fffebd; }
	.tippic{ width:87px; height:87px; float:left; margin:20px; display:inline;}
	a.otherlinks{padding:0 4px; margin:0px 8px 0 0;display:block;float:left;background:#fff;border:1px solid #ccc;overflow:hidden;text-decoration:none;}
	div,table,form,h5,p,h6{text-align:left;font-family:Arial,宋体;font-size:12px;padding:0;margin:0;border:0;line-height:22px;}
	.result table.listCont{background:url(${pageContext.request.contextPath}/StaticResource/images/list_dot.gif) repeat-x center bottom; cursor:pointer;}
	.result table.listCont_bg{background:#f1f6f9 url(${pageContext.request.contextPath}/StaticResource/images/list_dot.gif) repeat-x center bottom; cursor:pointer;}
	.result table.listCont_bg2{background:#f1f6f9 url(${pageContext.request.contextPath}/StaticResource/images/list_dot.gif) repeat-x center bottom; cursor:pointer;}
	
	.panel-body {
	  background-color: #FFFFFF;
	}
	</style>
	<script type="text/javascript">
		$(function() {
			$("#showLocation,#showScope,#hideNoAreaBranch").click(showItemClick);
			mapabcEditor = new MapabcEditor("ID_MapObj",[118.481375,32.031512]);
			tree = $.fn.zTree.init($("#ID_TREE"), setting);
			$("#keywordSearchInput").autocomplete("${pageContext.request.contextPath}/onlinemap/servicePointAutoComplete.do", keywordSearchOptions);
			$("#keywordSearchInput").live("focusin",function(){
				if($.trim(this.value)=="请输入服务网点关键字或者服务网点六位代码。"){
					this.value="";
					$(this).css({"color":"#000", "border-color":"#000"});
				}
			});
			$("#keywordSearchInput").live("focusout",function() {
				if($.trim(this.value)=="" || $.trim(this.value)=="请输入服务网点关键字或者服务网点六位代码。"){
					this.value="请输入服务网点关键字或者服务网点六位代码。";
					$(this).css({"color":"#a8a8a8", "border-color":"#c7c7c7"});
				}
			});
			$("#keywordSearchInput").keydown(function(event){
				if(event.keyCode==13)  {
		              $("#btnSearch").click();
		         }
			});

			$("#btnSearch").click(function(){
				keyword = $.trim($("#keywordSearchInput").val());
				if (keyword =="" || keyword=="请输入服务网点关键字或者服务网点六位代码。") {
					$.messager.alert(" ", "请输入服务网点关键字或者服务网点六位代码。");
					return;
				}
				pageNum(1);
			});
		});
		
		var servicePointShow = true;
		var branchArr = new Array();
		var tree;
		var page_now=1;
		var keyword="";
		var dimorphicIds = new Array();
		var circleInfos = [];
		
		var setting = {
				async: {
					enable: true,
					url:"<%=request.getContextPath()%>/onlinemap/servicePointTree.do?onlyShowReleased=true",
					autoParam:["id"]
				},
				check: {
					enable: true
				},
				data: {
					simpleData: {
						enable: true
					}
				},
				callback: {
					onCheck: showServicePoints
				}
		};
		
		var keywordSearchOptions = {
			minChars: 2,
			max: 10,
			delay: 500,
			matchContains: true,
			selectFirst: false,
			scrollHeight: 220,
			parse: function(data) {
				return data;
			},
			extraParams: {
				keyword:function() {
					return $("#keywordSearchInput").val();
				}
			},
			formatItem: function(data) {
				return data[0]+"——"+data[1];
			}
		};
		
		function showItemClick() {
			var showLocation = $("#showLocation").attr("checked");
			var showScope =$("#showScope").attr("checked");
			var hideNoAreaBranch = $("#hideNoAreaBranch").attr("checked");
			
			if (!showLocation && !showScope) {
				$.messager.alert(" ", "必须至少显示一样内容");
				$(this).attr("checked",true);
				return;
			}
			if (branchArr.length == 0) {
				return;
			}
			
			$("#areaStatus").show();
			$("#areaResult").hide();
			mapabcEditor.mapObj.removeAllOverlays();
			paintBranches2(branchArr,showLocation,showScope,hideNoAreaBranch);
			mapabcEditor.mapObj.setFitview(getBranchIds(branchArr, showLocation, showScope, hideNoAreaBranch));
			$("#areaStatus").hide();
			$("#areaResult").html("共有" + branchArr.length + "个网点。");
			$("#areaResult").show();
		}
		
		function showServicePoints(event, treeId, treeNode) {
			var showLocation = $("#showLocation").attr("checked");
			var showScope = $("#showScope").attr("checked");
			var hideNoAreaBranch = $("#hideNoAreaBranch").attr("checked");
			$("#areaStatus").show();
			$("#areaResult").hide();
			
			$.getJSON("${pageContext.request.contextPath}/onlinemap/servicePointTreeAjax.do?id=" + treeNode.id + "&r=" + Math.random(),function(branches){
				if (treeNode.checked) {
					paintBranches2(branches, showLocation, showScope, hideNoAreaBranch);	
					branchArr = branchArr.concat(branches);
				} else {
					var ids = getBranchIds(branches, showLocation, showScope, hideNoAreaBranch);
					for (var i=0;i<ids.length;i++) {
						mapabcEditor.mapObj.removeOverlayById(ids[i]);
					}
					for (var i = branchArr.length-1;i>=0;i--) {
						for (var j = 0;j<branches.length;j++) {
							if(branchArr[i].orgcode == branches[j].orgcode) {
								branchArr.splice(i,1);
								break;
							}
						}
					}
				}
				mapabcEditor.mapObj.setFitview(getBranchIds(branchArr, showLocation, showScope, hideNoAreaBranch));
				$("#areaStatus").hide();
				$("#areaResult").html("共有" + branchArr.length + "个网点。");
				$("#areaResult").show();
			});
		}
		
		function paintBranches2(branches, showLocation, showScope, hideNoAreaBranch) {
			mapabcEditor.mapObj.addEventListener(mapabcEditor.mapObj,MConstants.TIP_OPEN,tipOpenListener);
			for (var i=0;i<branches.length;i++) {
				var branch = branches[i];
				var data = new Object();
				data.orgBranch = branch.ydOrg;
				data.position = branch.positionGeo.geometryVectors[0];
				if (showScope) {
					for(var j=0;j<branch.serverGeos.length;j++){
						data["serviceArea" + j] = branch.serverGeos[j].geometryVectors;
					}
				}
				for(var j=0;j<branch.monitorGeos.length;j++){
					data["monitorCircle" + j] = branch.monitorGeos[j].geometryVectors[0];
				}
			    data.flag = true;
			    data.view = true;
			    data.branchextinfo = getBranchTextInfo(branch.ydOrg);
				var overlay = mapabcEditor.mapObj.getOverlayById(data.position.geometryid);
			    mapabcEditor.paintBranch(data,null,false,false);
				if ((!showLocation || (hideNoAreaBranch && branch.serverGeos.length == 0)) && !overlay) {
					mapabcEditor.mapObj.removeOverlayById(data.position.geometryid);
				}
			}
		}
		
		function getBranchIds(branchArr, showLocation, showScope, hideNoAreaBranch) {
			var ids = new Array();
			for (var i=0;i<branchArr.length;i++) {
				var branch = branchArr[i];
				if (showLocation && (!hideNoAreaBranch || branch.serverGeos.length > 0)) {
					ids.push(branch.positionGeo.geometryVectors[0].geometryid);
				}
				if (showScope) {
					for(var j=0;j<branch.serverGeos.length;j++){
						ids.push(branch.serverGeos[j].id);
					}
				}
				for(var j=0;j<branch.monitorGeos.length;j++) {
					ids.push(branch.monitorGeos[j].id);
					ids.push(branch.monitorGeos[j].id + "Circle");
				}
			}
			return ids;
		}
		
		function getBranchTextInfo(orgBranch){
			var textInfoArr = new Array();
			textInfoArr.push("<div><b>网点名称：</b>"+orgBranch.orgname+"<br/>");
			textInfoArr.push("<b>网点编码：</b>"+orgBranch.orgcode+"<br/>");
			textInfoArr.push("<b>负责人：</b>"+orgBranch.fzr+"<br/>");
			textInfoArr.push("<b>下单电话：</b>"+orgBranch.xddh+"<br/>");
			textInfoArr.push("<b>查询电话：</b>"+orgBranch.cxdh+"<br/>");
			textInfoArr.push("<b>投诉电话：</b>"+orgBranch.tsdh+"<br/>");
			textInfoArr.push("<b>地址：</b>"+orgBranch.address+"<br/>");
			textInfoArr.push("<b>派送范围：</b>"+orgBranch.psfw+"</div>");
			return textInfoArr.join("");
		}

		function lastPageNum(){
			pageNum(page_now-1);
		}
		
		function nextPageNum() {
			pageNum(page_now+1);
		}
		
		function pageNum(num) {
			$("#searchResult").hide();
			$("#searchStatus").show();
			$("#errorMsg_servicepointSearch").hide();
			mapabcEditor.mapObj.removeAllOverlays();
			$.ajax({
				type:"POST",
				contentType: "application/x-www-form-urlencoded; charset=UTF-8",
				url:"${pageContext.request.contextPath}/onlinemap/servicePointKeyword.do",
				data:{"keyword":keyword ,"curpage":num},
				dataType:"json",
				success:function(json){
					page_now = json.page_now;
					branchArr = json.branches;
					keywordSearchCallback(json);
					paintBranches2(json.branches, true, true, false);
					mapabcEditor.mapObj.setFitview(getBranchIds(json.branches, true, true, false));
				}
			});
		}
		
		function keywordSearchCallback(data) {
			$("#searchResult").html("共有" + data.count + "个网点。");
			$("#searchStatus").hide();
			$("#searchResult").show();
			var html = new Array();
			if (data.count == 0) {
				$("#errorMsg_servicepointSearch").show().siblings().hide();
			} else if(data.branches){
				for(var i=0; i<data.branches.length; i++) {
					var branch = data.branches[i];
					var position = branch.positionGeo.geometryVectors[0];
					html.push("<table id=\"ydwd_"+ position.geometryid +"_"+ position.longitude +"_"+position.latitude+"\" cellpadding=\"0\" cellspacing=\"0\" class=\"listCont\">");
					html.push("<tr><td colspan=2 style=\"height:10px; line-height:0;\">&nbsp;</td></tr>");
					html.push("<tr><td rowspan=4 width=40 align=center valign=\"top\" ><img 		src=\"${pageContect.request.contextPath}/StaticResource/images/num/"+(i+1)+".gif\" /></td><td width=\"448\" valign=\"top\"><span style=\"float:right;margin-right:28px;\"></span><u><strong>" + branch.ydOrg.orgname + "</strong></u></td></tr>");
					html.push("<tr><td>地址："+ branch.ydOrg.address +"</td></tr>");
					html.push("<tr><td>负责人："+ branch.ydOrg.fzr +"</td></tr>");
					html.push("<tr><td>查询电话："+ branch.ydOrg.cxdh +"</td></tr>");
					html.push("<tr><td></td><td>");
					if(branch.ydOrg.orgtype == 2) {
						html.push("<a href=\"javascript:void(0);\"  onclick=\"javascript:showServiceAreas('" + branch.ydOrg.orgcode + "');return false;\" class=\"otherlinks\">显示覆盖范围</a>");
					}
					html.push("<a href=\"javascript:void(0);\"  onclick=\"javascript:window.open('http://www.yundaex.com/fuwuwangdian_data.php?id=" +	branch.ydOrg.orgcode + "');return false;\" class=\"otherlinks\">更多详细信息</a>");
					html.push("</td></tr>");
					html.push("<tr><td colspan=2 style=\"height:10px; line-height:0;\">&nbsp;</td></tr>");
					html.push("</table>");
				}
			}
			var pageText = ShowPage(data.count,data.page_now);
			$("#resultAround>div:not(:first-child)").remove();//删除所有子div（除了第一个）
			$("#resultAround>table").remove();//删除所有子table
			$("#resultAround").append(html.join("")+pageText);
			$("#resultAround").show();
		}

		function ShowPage(RecCount,CurrPage){
			var PrevFont = "上一页";
			var NextFont = "下一页";
			var RecPerPage = 10;
			var PageNum = 4;
			var PageCount = RecCount%RecPerPage==0?RecCount/RecPerPage:(parseInt(RecCount/RecPerPage) + 1);
			if (PageCount==1) {
				CurrPage=1;
				PrevPageUrl="&nbsp;"+PrevFont+"&nbsp;";
				NextPageUrl="&nbsp;"+NextFont+"&nbsp;";
			} else if (CurrPage==1) {
				CurrPage=1;
				PrevPageUrl="&nbsp;"+PrevFont+"&nbsp;";
				NextPageUrl="&nbsp;<a href=\"javascript:nextPageNum();\">"+NextFont+"</a>&nbsp;";
			} else if (CurrPage==PageCount) {
				CurrPage=PageCount;
				PrevPageUrl="&nbsp;<a href=\"javascript:lastPageNum();\">"+PrevFont+"</a>&nbsp;";
				NextPageUrl="&nbsp;"+NextFont+"&nbsp;";
			} else {
				CurrPage=CurrPage;
				PrevPageUrl="&nbsp;<a href=\"javascript:lastPageNum();\">"+PrevFont+"</a>&nbsp;";
				NextPageUrl="&nbsp;<a href=\"javascript:nextPageNum();\">"+NextFont+"</a>&nbsp;";
			}
			PageStart = (CurrPage-PageNum<=1 || PageCount-2*pageNum<1)?1:(CurrPage+PageNum>PageCount?PageCount-2*pageNum:CurrPage-PageNum);
			PageEnd = (CurrPage+PageNum>=PageCount || 2*pageNum + 1 > PageCount)?PageCount:(CurrPage-PageNum<1?2*PageNum+1:CurrPage+PageNum);
			var html=new Array();
			html.push("<div class=\"list\" style=\" display:;\">");
			html.push("<div  id=\"page\" style=\" text-indent:10px;\">");
			html.push(PrevPageUrl);
			for (var i=PageStart;i<=PageEnd;i++) {
				if (i==CurrPage) {
					html.push("&nbsp;["+i+"]&nbsp;");
				}else{
					html.push("&nbsp;<a href=\"javascript:pageNum("+i+");\">"+i+"</a>&nbsp;");
				}
			}
			html.push(NextPageUrl);
			html.push("</div></div><div class=\"cc\"></div>");
			return html.join("");
		}
		
		$("table[id^=ydwd_]").live("click",function(event){
			var x = this.id.split("_")[2];
			var y = this.id.split("_")[3];
			var oid = this.id.split("_")[1];
			var targerE = event.target;
			if(targerE.innerHTML!="更多详细信息" && targerE.innerHTML!="显示覆盖范围"){
				mapabcEditor.mapObj.openOverlayTip(oid);
				$("#resultAround>table[id^=ydwd_"+oid+"_]").attr("class","listCont_bg").siblings("table[id^=zbjg_]").attr("class","listCont");
			}

		});
		
		$("#resultAround>table").live("mouseover",function(){
			$(this).addClass("listCont_bg2");
		});
		$("#resultAround>table").live("mouseout",function(){
			$(this).removeClass("listCont_bg2");
		});
		
		function getBranchIds(branchArr, showLocation, showScope, hideNoAreaBranch) {
			var ids = new Array();
			for (var i=0;i<branchArr.length;i++) {
				var branch = branchArr[i];
				if (showLocation && (!hideNoAreaBranch || branch.serverGeos.length > 0)) {
					ids.push(branch.positionGeo.geometryVectors[0].geometryid);
				}
				if (showScope) {
					for(var j=0;j<branch.serverGeos.length;j++){
						ids.push(branch.serverGeos[j].id);
					}
				}
				for(var j=0;j<branch.monitorGeos.length;j++) {
					ids.push(branch.monitorGeos[j].id);
					ids.push(branch.monitorGeos[j].id + "Circle");
				}
			}
			return ids;
		}
		
		function showServiceAreas(orgcode) {
			$.ajax({
				type:"POST",
				url:"<%=request.getContextPath()%>/onlinemap/servicePointScope.do?CLIENT=AJAX_JSON&r=" + Math.random(),
				data:"orgcode="+orgcode,
				dataType:"json",
				success:function(branches){
					setOverlayDimorphicByIds(dimorphicIds,false);
					var fitViews= new Array();
					var overlayId;
					paintBranches2(branches,false,true,false);
					for (var i = 0;i<branches.length;i++) {
						var branch = branches[i];
						fitViews = getBranchIds(branches, false, true, false)
						if (branch.ydOrg.orgcode == orgcode ){
							overlayId = branch.positionGeo.geometryVectors[0].geometryid;
							fitViews.push(branch.positionGeo.geometryVectors[0].geometryid);
						}
					}
					setOverlayDimorphicByIds(fitViews,true);
					mapabcEditor.mapObj.setFitview(fitViews);
					dimorphicIds = fitViews;
					mapabcEditor.mapObj.removeEventListener(mapabcEditor.mapObj,MConstants.TIP_OPEN,tipOpenListener);
					mapabcEditor.mapObj.openOverlayTip(overlayId);
					mapabcEditor.mapObj.addEventListener(mapabcEditor.mapObj,MConstants.TIP_OPEN,tipOpenListener);
				}
			});
		}
		
		function tipOpenListener(event){
			var currentBranch;
			for (var i=0;i<branchArr.length;i++) {
				var branch = branchArr[i];
				if (event.overlayId == branch.positionGeo.geometryVectors[0].geometryid) {
					currentBranch = branch;
					break;
				}
				for(var j=0;j<branch.serverGeos.length;j++){
					if (event.overlayId == branch.serverGeos[j].id) {
						currentBranch = branch;
						break;
					}
				}
				for(var j=0;j<branch.monitorGeos.length;j++) {
					if (event.overlayId == branch.monitorGeos[j].id || event.overlayId == branch.monitorGeos[j].id + "Circle") {
						currentBranch = branch;
						break;
					}
				}
			}
			if (currentBranch){
				var positionId = currentBranch.positionGeo.geometryVectors[0].geometryid;
				$("#resultAround>table[id^=ydwd_"+ positionId +"_]").attr("class","listCont_bg").siblings("table[id^=ydwd_]").attr("class","listCont");
				var ids = new Array();
				ids.push(positionId);
				for(var i=0;i<currentBranch.serverGeos.length;i++){
					ids.push(currentBranch.serverGeos[i].id);
				}
				for(var i=0;i<branch.monitorGeos.length;i++) {
					ids.push(branch.monitorGeos[i].id);
					ids.push(branch.monitorGeos[i].id + "Circle");
				}
				setOverlayDimorphicByIds(dimorphicIds,false);
				setOverlayDimorphicByIds(ids,true);
				dimorphicIds = ids;
			}
		}
		
		function setOverlayDimorphicByIds(ids,isDimorphic) {
			if (ids.length > 0) {
				for (var i=0;i<ids.length;i++) {
					mapabcEditor.mapObj.setOverlayDimorphicById(ids[i],isDimorphic);
				}
			}
		}
		
		function viewCircle() {
			$.messager.show({
				title:'画圆',
				height:180,
				msg:'在地图上画一个圆查看这个圆中的所有网点。<br/>（单击左键画圆心，左键拖动画半径）',
				showType:'show'
			});
			mapabcEditor.mapObj.addEventListener(mapabcEditor.mapObj,MConstants.ADD_OVERLAY,finishdraw);
			mapabcEditor.mapObj.setCurrentMouseTool(MConstants.DRAW_CIRCLE,MapabcOverlayStyle.viewStationCircleOption());
		}
		
		function finishdraw() {
			var circles = mapabcEditor.mapObj.getOverlaysByType(MOverlay.TYPE_CIRCLE);
			var curCircle;
			if (circles && circles.length > 0) {
				curCircle = circles[circles.length-1];
				var radius = curCircle.radius;
				if (radius > 50000) {
					$.messager.alert("信息","请不要画超过50公里的圆。","info");
				} else {
					var lngX = curCircle.center.lngX;
					var latY = curCircle.center.latY;
					$.ajax({
						type:"POST",
						url:"<%=request.getContextPath()%>/back/ydBranch/getCircleBranches.do?r=" + Math.random(),
						data:"lngX="+lngX+"&latY="+latY+"&radius="+radius,
						success:function(text){
							if($.trim(text)=='') {
								$.messager.alert('信息','该区域没有网点!','info');
							} else {
								$.each($.trim(text).split(","),function(i,n) {
									
										$.ajax({
											url:'<%=request.getContextPath()%>/back/ydBranch/getBranchInfo.do?businesskey='+n,
											type:"get",
											success:function(data){
												data.branchextinfo = getBranchTextInfo(data.orgBranch);
												data.flag = false;
												mapabcEditor.paintBranch(data,null,null,false);
											}
										});
									
								});
								$.messager.alert("信息","该区域共有" + $.trim(text).split(",").length + "个网点。","info");
							}
						}
					})
				}		
			}
			if (curCircle && curCircle.id) {
				mapabcEditor.mapObj.removeOverlayById(curCircle.id);
			}
			mapabcEditor.mapObj.setCurrentMouseTool(MConstants.PAN_WHEELZOOM);
			mapabcEditor.mapObj.removeEventListener(mapObj,MConstants.ADD_OVERLAY,finishdraw);
		}
	</script>
</head>

<body class="easyui-layout">
	<div data-options="region:'west', width:400, split:true">
		<div class="easyui-tabs" data-options="tabWidth:120, fit:true, border:false">
			<div title="区域查询">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'north', height:40, border:false, style:{padding:'10px'}">
						<input id="showLocation" type="checkbox" checked="checked" />
						<label for="showLocation">显示网点位置</label>&nbsp;
						<input id="showScope" type="checkbox" checked="checked" />
						<label for="showScope">显示派送范围</label>&nbsp;
						<input id="hideNoAreaBranch" type="checkbox" />
						<label for="hideNoAreaBranch">隐藏无范围的网点</label>
					</div>
					<div data-options="region:'center', border:false" class="treeContent">
						<ul id="ID_TREE"  class="ztree"></ul>
					</div>
					<div data-options="region:'south', border:false, height:25">
						<div class="title" id="areaStatus" style="display:none;">结果加载中... </div>
						<div class="title" id="areaResult" style="display:none;"></div>
					</div>
				</div>
			</div>
			<div title="关键字查询">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'north', height:120, border:false" class="keywordSearch treeContent">
						<input type="text" id="keywordSearchInput" value="请输入服务网点关键字或者服务网点六位代码。" class="input_def">
						<a type="button" id="btnSearch" class="easyui-linkbutton searchBtn">查询</a>
					</div>
					<div data-options="region:'center', border:false">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'north', height:25, border:false">
								<div class="title" id="searchStatus" style="display:none;">结果加载中... </div>
								<div class="title" id="searchResult" style="display:none;"></div>
							</div>
							<div data-options="region:'center', border:false">
								<div class="error" id="errorMsg_servicepointSearch" style=" display:none;">
									<div class="no_answer">抱歉,没有找到您输入的服务网点</div>
									<div class="tippic"><img src="${pageContexgt.request.contextPath}/StaticResource/images/tippic.jpg" /></div>
									<div style="margin-top:20px;">建议：<br />
										1.减少您的关键字字数。<br />
										2.尝试其他的关键字。<br />
									</div>
								</div>
								<div class="result" id="resultAround">
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	<div data-options="region:'center'">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north', height:29, border:false" style="background:#f0e3bf;border-bottom:solid 1px #D4A375;padding-top:7px;">
				<span style="float:left;padding-left:10px">
					<label id="cityshow">全国</label>
					<a href="javaScript:citylistBoxindex();">【更换城市】</a>
				</span>
				<span style="float:right;margin-right:10px;">
					<a href="javascript:void(0);" onclick="viewCircle();return false;" title="在地图上单击鼠标左键，拖动滑出范围，查看范围内的服务网点">画圆查看</a>
					<a href="javascript:void(0);" onclick="var option={};option.hasCircle=true; option.hasPrompt=false; mapabcEditor.mapObj.setCurrentMouseTool(RULER,option);">测距</a>
					<a href="javascript:void(0);" onclick="mapabcEditor.mapObj.setCurrentMouseTool(PAN_WHEELZOOM);">移动</a>	
					<a href="javascript:void(0);" onclick="mapabcEditor.mapObj.removeAllOverlays();">清除</a>
				</span>
			</div>
			<div id="ID_MapObj" data-options="region:'center', border:false" style="background:#eee;overflow:visible">
				<span style="position: absolute;  bottom:32px; left:10px;">全屏</span>
			</div>
		</div>
	</div>
		
</body>

</html>